package com.zyong.design.pattern.observer.case1;

/**
 * @program: zyong-design-pattern
 * @ClassName: Client
 * @author: zyong
 * @create: 2024-05-14 00:12
 */
public class Client {
    public static void main(String[] args) {
        ConcreteSubject concreteSubject = new ConcreteSubject();

        ConcreteObserver concreteObserver1 = new ConcreteObserver(concreteSubject);
        ConcreteObserver concreteObserver2 = new ConcreteObserver(concreteSubject);

        concreteSubject.setState(10);

        concreteSubject.setState(20);

        concreteSubject.unregisterObserver(concreteObserver2);

        concreteSubject.setState(30);
    }
}
